﻿@inject ShellNavigationManager NavigationManager
<ContentPage>
    <CollectionView ItemsSource="MonkeyData.Monkeys">
        <ItemTemplate>
            <AnimalTemplate Animal="context" OnClick="AnimalClicked" />
        </ItemTemplate>
    </CollectionView>
</ContentPage>

@code {
    async Task AnimalClicked(Animal animal)
    {
        await NavigationManager.NavigateToAsync($"/monkeydetails/{animal.Name}");
    }
}